import Base from './base'
const api = new Base()

export const addGoods = (data: any) => api.post('/goods/add', data)
export const updateGoods = (data: any) => api.put(`/goods/${data.id}`, data)
export const delGoods = (id: string) => api.delete(`/goods/${id}`)
export const getGoodsList = (data: any) => api.get('/goods/page', data)
export const getGoods = (id: string) => api.get(`/goods/${id}`)

export const addStore = (data: any) => api.post('/store/add', data)
export const updateStore = (data: any) => api.patch(`/store/${data.id}`, data)
export const delStore = (id: string) => api.delete(`/store/${id}`)
export const getStoreList = (data: any) => api.get('/store/page', data)
export const getStore = (id: string) => api.get(`/store/${id}`)
export const getStoreByUser = () => api.get(`/store/user`)

export const addCategory = (data: any) => api.post('/goodsCategory/add', data)
export const updateCategory = (data: any) => api.patch(`/goodsCategory/${data.id}`, data)
export const delCategory = (id: string) => api.delete(`/goodsCategory/${id}`)
export const getCategoryList = (data: any) => api.get('/goodsCategory/page', data)
export const getCategory = (id: string) => api.get(`/goodsCategory/${id}`)

export const addComment = (data: any) => api.post('/goodsComment/add', data)


export const getComments = (data: any) => api.get('/goodsComment/page', data)



export const getRules = (data:any) => api.get('/sysTenantRule/page', data)